/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Servidor;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
//import org.codehaus.jackson.annotate.JsonIgnore;

/**
 *
 * @author daniel
 */
@Entity
@Table(name = "Nodo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Nodo.findAll", query = "SELECT n FROM Nodo n"),
    @NamedQuery(name = "Nodo.findByIDNodo", query = "SELECT n FROM Nodo n WHERE n.iDNodo = :iDNodo"),
    @NamedQuery(name = "Nodo.findByNodoId", query = "SELECT n FROM Nodo n WHERE n.nodoId = :nodoId"),
    @NamedQuery(name = "Nodo.findByNodoRamPor", query = "SELECT n FROM Nodo n WHERE n.nodoRamPor = :nodoRamPor"),
    @NamedQuery(name = "Nodo.findByNodoCpu", query = "SELECT n FROM Nodo n WHERE n.nodoCpu = :nodoCpu")})
public class Nodo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "IDNodo")
    private Integer iDNodo;
    @Basic(optional = false)
    @Column(name = "nodo_id")
    private String nodoId;
    @Basic(optional = false)
    @Column(name = "nodo_ram_por")
    private String nodoRamPor;
    @Basic(optional = false)
    @Column(name = "nodo_cpu")
    private String nodoCpu;
    @OneToMany(mappedBy = "fkNodoDirectorio")
    private Collection<Directorio> directorioCollection;
    @OneToMany(mappedBy = "fkNodoProceso")
    private Collection<Proceso> procesoCollection;

    public Nodo() {
    }

    public Nodo(Integer iDNodo) {
        this.iDNodo = iDNodo;
    }

    public Nodo(Integer iDNodo, String nodoId, String nodoRamPor, String nodoCpu) {
        this.iDNodo = iDNodo;
        this.nodoId = nodoId;
        this.nodoRamPor = nodoRamPor;
        this.nodoCpu = nodoCpu;
    }

    public Integer getIDNodo() {
        return iDNodo;
    }

    public void setIDNodo(Integer iDNodo) {
        this.iDNodo = iDNodo;
    }

    public String getNodoId() {
        return nodoId;
    }

    public void setNodoId(String nodoId) {
        this.nodoId = nodoId;
    }

    public String getNodoRamPor() {
        return nodoRamPor;
    }

    public void setNodoRamPor(String nodoRamPor) {
        this.nodoRamPor = nodoRamPor;
    }

    public String getNodoCpu() {
        return nodoCpu;
    }

    public void setNodoCpu(String nodoCpu) {
        this.nodoCpu = nodoCpu;
    }

    @XmlTransient
   // @JsonIgnore
    public Collection<Directorio> getDirectorioCollection() {
        return directorioCollection;
    }

    public void setDirectorioCollection(Collection<Directorio> directorioCollection) {
        this.directorioCollection = directorioCollection;
    }

    @XmlTransient
  //  @JsonIgnore
    public Collection<Proceso> getProcesoCollection() {
        return procesoCollection;
    }

    public void setProcesoCollection(Collection<Proceso> procesoCollection) {
        this.procesoCollection = procesoCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (iDNodo != null ? iDNodo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Nodo)) {
            return false;
        }
        Nodo other = (Nodo) object;
        if ((this.iDNodo == null && other.iDNodo != null) || (this.iDNodo != null && !this.iDNodo.equals(other.iDNodo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Servidor.Nodo[ iDNodo=" + iDNodo + " ]";
    }
    
}
